<template>
  <div>
    <h1>Welcome to Home</h1>
    <button>Logout</button>
  </div>
</template>

<script>
export default {
  methods: {
    logout() {
      this.$auth.logout()
          .then(() => {
            this.$router.push('/')
          })
          .catch(error => {
            console.error(error)
          })
    }
  }
}
</script>